<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Vue入门-v-if v-show v-for</title>
		<script src="vue.js"></script>
	</head>
	<body>
		<!-- 挂载点，模板，实例之间的关 -->
		<div id="root">
			<div v-if="show">hello world</div>
			<div v-show="show">hello world</div>
			<button @click="hindleClick">toggle</button>
			<ul>
				<li v-for="item of list" :key="item">{{item}}</li>
			</ul><ul>
				<li v-for="(item ,index) of list2" :key="index">{{item}}</li>
			</ul>
		</div>
		<script>
			new Vue({
				el: "#root",
				data: {
					show: true,
					list: [1, 2, 3],
					list2: [1, 1, 3]
				},
				methods: {
					hindleClick() {
						this.show = !this.show;
					}
				}

			})
		</script>
	</body>
</html>
